<template>
    <% if(multiple){ %>
    <div class="layui-inline">
    <% } %>
        <label class="layui-form-label"><%= title %></label>
        <!--&&htmlchildren&&-->
    <% if(multiple){ %>
    </div>
    <% } %>
</template>
<script name="compile">
    function templateCompile(data) {
        var defaultData = {
            type: "module",
            //是否多个兄弟元素
            multiple: false,
        };
        var newData = Object.assign(defaultData, data);
        var callback = {
            success: true,
            result: newData
        };
        if (!newData.title) {
            return {
                success: false,
                result: "请输入表单名称，参数名：title"
            };
        }
        if(newData.children && newData.children.content && newData.children.content instanceof Array){
            if(newData.children.content.length == 1 && !newData.multiple){
                newData.children.content.map(item => {
                    item.viewType = "block";
                    return item;
                });
            }
        }
        return callback;
    }
</script>
<script name="templateScript">
    //&&scriptchildren&&
</script>